
#@layoutT("主页")
#define css()
 <link rel="stylesheet" href="#(path)/static/css/home.css?t=#now()" media="all">
#end
#define main()
  <div class="layui-row layui-col-space15">   
    <div class="layui-col-sm6 layui-col-md3">
      <div class="layui-card">
        <div class="layui-card-header">
          总计用户量
          <span class="layui-badge layui-bg-blue admin-badge">周</span>
        </div>
        <div class="layui-card-body admin-card-list">
          <p class="admin-big-font"  id = "numberofc">-----</p>
          <p>
            新增用户
            <span class="admin-span-color" id = "numberofnewc">----- <i class="layui-icon">&#xe66c;</i></span>
          </p>
        </div>
      </div>
    </div>
    <div class="layui-col-sm6 layui-col-md3">
      <div class="layui-card">
        <div class="layui-card-header">
          总计告警
          <span class="layui-badge layui-bg-cyan admin-badge">日</span>
        </div>
        <div class="layui-card-body admin-card-list">
          <p class="admin-big-font" id ="numberofw">-----</p>
          <p>
            新增告警
            <span class="admin-span-color" id ="numberofneww">----- <i class="layui-icon">&#xe650;</i></span>
          </p>
        </div>
      </div>
    </div>
    <div class="layui-col-sm6 layui-col-md3">
      <div class="layui-card">
        <div class="layui-card-header">
          设备统计
          <span class="layui-badge layui-bg-green admin-badge">日</span>
        </div>
        <div class="layui-card-body admin-card-list">
          <p class="admin-big-font" id = "numberofd">-----</p>
          <p>
            新增设备
            <span class="admin-span-color" id = "numberofnewd">----- <i class="layui-icon">&#xe650;</i></span>
          </p>
        </div>
      </div>
    </div>
    <div class="layui-col-sm6 layui-col-md3">
      <div class="layui-card">
        <div class="layui-card-header">
          在线统计
          <span class="layui-badge layui-bg-red admin-badge">月</span>
        </div>
        <div class="layui-card-body admin-card-list">
          <p class="admin-big-font">-----</p>
          <p>
            在线统计
            <span class="admin-span-color">-----<i class="layui-icon">&#xe650;</i></span>
          </p>
        </div>
      </div>
    </div>

      <div class="layui-row layui-col-space15">
        <div class="layui-col-md3">
          <div class="layui-card">
            <div class="layui-card-header">系统日志</div>
            <div class="layui-card-body">
              <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                  <table id="maingrid" lay-filter="maingrid"></table>
                  <!-- 	每行的操作按钮 -->
                </div>
              </div>
            </div>
          </div>
        </div>



        <div class="layui-col-md4">
          <div class="layui-card">
            <div class="layui-card-header">用户列表</div>
            <div class="layui-card-body">
              <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                  <table id="userinfo" lay-filter="maingrid"></table>
                  <!-- 	每行的操作按钮 -->
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="layui-col-md5">
          <div class="layui-card">
            <div class="layui-card-header">预警列表</div>
            <div class="layui-card-body">
              <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                  <table id="warninfo" lay-filter="maingrid"></table>
                  <!-- 	每行的操作按钮 -->
                  <script type="text/html" id="bar_warninfo">
                    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
                  </script>
                </div>
              </div>

            </div>
          </div>
        </div>


      </div>


  </div>
   	
   	
#end

#define js()
<script src="#(path)/static/libs/echarts/echarts.min.js"></script>
<script src="#(path)/static/libs/echarts/ecstat/ecStat.min.js"></script>
<script src="#(path)/static/libs/echarts/echarts.tool.js"></script>
<script type="text/javascript">

  var userCode="#(vs.code)";
  gridArgs.title='系统日志';
  gridArgs.dataId='id';
  gridArgs.detailUrl='#(path)/portal/core/sysLog/detail/';
  gridArgs.deleteUrl='#(path)/portal/core/sysLog/delete';
  gridArgs.gridDivId ='maingrid';
  gridArgs.pageSize=7;
  gridArgs.limits=[7,20,30,40,50];
  initGrid({id : 'maingrid'
    ,elem : '#maingrid'
    ,cellMinWidth: 80
    ,height:360
    ,cols : [ [
      {title: '序号',type:'numbers',width:35},
      {title: '操作用户', field: 'user_code'},
      {title: '操作时间', field: 'create_time'},
      {title: '资源类型', field: 'method_name'}
    ] ]
    ,url:"#(path)/portal/core/sysLog/list"
  });




  var userCode="#(vs.code)";
  gridArgs.dataId='id';
  gridArgs.detailUrl='#(path)/portal/business/iCustomerInfo/edit';
  gridArgs.deleteUrl='#(path)/portal/business/iCustomerInfo/delete/';
  gridArgs.gridDivId ='userinfo';
  gridArgs.pageSize=7;
  gridArgs.limits=[7,20,30,40,50];
  initGrid({id : 'maingrid'
    ,elem : '#userinfo'
    ,cellMinWidth: 120
    ,height:360
    ,cols : [ [
      {title: '客户姓名', field: 'customername'},
      {title: '证件号', field: 'idcard'},
      {title: '关联设备', field: 'devideid'}
    ] ]
    ,url:"#(path)/portal/business/iCustomerInfo/list"
  });

  var userCode="#(vs.code)";
  gridArgs.dataId='devideid';
  gridArgs.detailUrl='#(path)/portal/business/iDeviceInfo/edit/';
  gridArgs.deleteUrl='#(path)/portal/business/iDeviceInfo/delete/';
  gridArgs.gridDivId ='warninfo';
  gridArgs.pageSize=7;
  gridArgs.limits=[7,20,30,40,50];
  initGrid({id : 'warninfo'
    ,elem : '#warninfo'
    ,cellMinWidth: 40
    ,height:360
    ,cols : [ [
      {title: '设备编号', field: 'devideid'},
      {title: '设备状态', field: 'status'},
      {title: '操作 ',fixed:'right',align : 'left',toolbar : '#bar_warninfo'} // 这里的toolbar值是模板元素的选择器
    ] ]
    ,url:"#(path)/portal/business/iDeviceInfo/list"
  });


  $.ajax({
    url:'#(path)/portal/business/iCustomerInfo/queryMsg'
    ,type:'POST'
    ,success:function(ret){
      document.getElementById("numberofc").innerHTML = ret.numberofc;
      document.getElementById("numberofnewc").innerHTML = ret.numberofnewc;
      document.getElementById("numberofw").innerHTML = ret.numberofw;
      document.getElementById("numberofneww").innerHTML = ret.numberofneww;
      document.getElementById("numberofd").innerHTML = ret.numberofd;
      document.getElementById("numberofnewd").innerHTML = ret.numberofnewd;
    }
  });
	
</script>

#end


